﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace project_pong_arena
{
    class Jogador
    {
        private Texture2D textura;
        private Vector2 posicao;
        private Rectangle rectangle;

        public Jogador()
        {
        }

        public Jogador(Texture2D textura, Vector2 posicao)
        {
            this.textura = textura;
            this.posicao = posicao;
            rectangle = new Rectangle((int)posicao.X, (int)posicao.Y, textura.Width, textura.Height);
        }
        
        public Texture2D Textura
        {
            set 
            { 
                textura = value;
                rectangle = new Rectangle((int)posicao.X, (int)posicao.Y, textura.Width, textura.Height);
            }
            get { return textura; }
        }

        public float PosicaoX
        {
            set 
            { 
                posicao.X = value;
                rectangle = new Rectangle((int)posicao.X, (int)posicao.Y, textura.Width, textura.Height);
            }
            get { return posicao.X; }
        }

        public float PosicaoY
        {
            set 
            { 
                posicao.Y = value;
                rectangle = new Rectangle((int)posicao.X, (int)posicao.Y, textura.Width, textura.Height);
            }
            get { return posicao.Y; }
        }

        public Vector2 PosicaoXY
        {
            set 
            { 
                posicao = value;
                rectangle = new Rectangle((int)posicao.X, (int)posicao.Y, textura.Width, textura.Height);
            }
            get { return posicao; }
        }

        public Rectangle Rectangle
        {
            set { rectangle = value; }
            get { return rectangle; }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(textura, posicao, Color.White);
        }
    }
}
